<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org"  th:headers="utf-8">
    <head>
        <meta charset="UTF-8">
        <title>调寝功能</title>
        <meta name="renderer" content="webkit">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
        <link rel="stylesheet" th:href="@{/css/font.css}">
        <link rel="stylesheet" th:href="@{/css/index.css}">
        <script type="text/javascript" th:src="@{/lib/layui/layui.js}" charset="utf-8"></script>
        <script type="text/javascript" th:src="@{/js/index.js}"></script>
        <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->

    </head>
<body>
<div class="layui-fluid">
    <form method="get" th:action="@{/student/getdoma/{id}(id=${ID})}">
        <div class="layui-row">

            <div class="layui-form-item">
                <label for="id" class="layui-form-label">
                    <span class="x-red"></span>姓名
                </label>
                <div class="layui-input-inline">
                    <input type="text" id="id" name="student_id" required="" lay-verify="required" th:value="${ID}" disabled=""
                           autocomplete="off" class="layui-input">
                </div>
                <div class="layui-form-mid layui-word-aux">
                    <span class="x-red"></span>
                </div>
            </div>
            <hr >
            <div class="layui-form-item">
                <label for="dormi_num" class="layui-form-label">

                    <span class="x-red"></span>推荐
                </label>
                <div class="layui-input-inline">
<!--                    <input type="text" id="dormi_num" name="dormi_num " required=""   list="typelist"  placeholder="请选择"-->
<!--                           autocomplete="off" class="layui-input">-->
<!--                   <datalist id="typelist">-->
<!--                       <option  value="null" selected> </option>-->
<!--                        　　     <option >Dimond</option>-->
<!--                       　　    <option>vertical</option>-->


<!--                   </datalist>-->
                    <select id="dormi_num" name="Dormi_num" style="width: 360px;height: 36px">
                        <option selected text=" "></option>

                        <option th:each="dom:${DORMS} ">
                            <span  th:text="${dom.get('text')}"></span>
                        </option>

                    </select>
                </div>
                <div class="layui-form-mid layui-word-aux">
                    <span class="x-red"></span>

                </div>
            </div>
            <hr>

            <label  class="layui-form-label">
                <span class="x-red"></span>手动查询输入
            </label>

                 <div class="layui-inline layui-show-xs-block">
                 <input class="layui-input" id="apart" name="apart_num" th:value="${apart}" autocomplete="off" placeholder="请输入公寓号" >
             </div>
                 <div class="layui-inline layui-show-xs-block">
                     <input class="layui-input" id="dormi" name="dormi_num" th:value="${dormi}" autocomplete="off" placeholder="请输入寝室号" >
                 </div>
                 <div class="layui-inline layui-show-xs-block">
                     <input type="text " id="bed" name="bed_num" th:value="${bed}" placeholder="请输入床位号" autocomplete="off" class="layui-input">
                 </div>
                 <div class="layui-inline layui-show-xs-block">
                     <a class="layui-btn"  lay-submit="" lay-filter="sreach" onclick="ishavebednum()" >&#xe615;检测</a>
                 </div>

            <hr>


        </div>
        <div class="layui-form-item">
            <label  class="layui-form-label">
            </label>
            <button  class="layui-btn"  lay-submit="">
                提交
            </button>
        </div>
        <div>
            <a style="color: red" th:text="${rgs}" th:if="${not #strings.isEmpty(rgs)}"></a>
        </div>
    </form>

    </div>
</body>
<script>
    function ishavebednum()
    {
      var apart=document.getElementById("apart")
        var  dormi=document.getElementById("dormi")
        var bed=document.getElementById("bed")
        var id=document.getElementById("id");
        window.location.href="/student/getdoma/souch?apart="+apart.value+"&dormi="+dormi.value+"&bed="+bed.value+"&id="+id.value
    }
</script>
</html>